﻿<%@ Page Language="C#" EnableEventValidation="false" enableViewStateMac="false" MasterPageFile="~/default.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Webcar.Login" Title = "车辆管理登陆" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

        <div style="height:50px"></div>
        <div style="z-index:-1;text-align: center">
            <table id="LoginArea" width="300px" cellpadding="0" cellspacing="1">
	<tr>
		<td >
			<div id="header" style="text-align: left">登陆</div>
		</td>
	</tr>
	<tr>
	<td >
	    <table width="100%" cellpadding="0" cellspacing="0">
	        <tr class = "noborderarea">
		        <td style="text-align: right; width: 104px; height: 25px;">
                    用户ID：</td>
                    <td style="height: 25px; text-align: left">
                    <asp:TextBox ID="UserID" onblur="lostfocus()" runat="server" Width="112px"></asp:TextBox></td>
	        </tr>
	        <tr class = "noborderarea"> 
		        <td style="text-align: right; width: 104px; height: 25px;">
                    用户名：</td>
                    <td style="height: 25px; text-align: left">

                                <asp:TextBox ID="UserName" runat="server" Enabled="False" Width="112px"></asp:TextBox>


                    </td>
	        </tr>
	        <tr class = "noborderarea"> 
		        <td style="text-align: right; width: 104px; height: 25px;">
                    所属单位：</td>
                    <td style="height: 25px; text-align: left">
                        
                                <asp:TextBox ID="tbDeptName" runat="server" Enabled="False" Width="112px"></asp:TextBox>


                    </td>
	        </tr>
	        <tr class = "noborderarea">
		        <td style="text-align: right; width: 104px; height: 25px;">
                    密码：</td>
                    <td style="height: 25px; text-align: left"><asp:TextBox TextMode="Password" ID="Password" runat="server" Width="112px"></asp:TextBox></td>
	        </tr>
    	
	        <tr class = "noborderarea">
	            <td style="width: 104px">
               </td>
                <td>
                    
                    <asp:ImageButton ID="ImageButton1" runat="server" SkinID="login" OnClick="ImageButton1_Click"/>   
                </td>
	        </tr>
	        <tr class = "noborderarea">
	        <td colspan="2">
	        </td>
	        </tr>
	     </table>
	    </td>
	</tr>
</table>
<script language="javascript">
function lostfocus()
{
    //触发button1的事件，得到用户名
    var userid = document.getElementById("<%= UserIDClientID%>").value;
	if(userid=="")
		return;
	var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
	xmlHttp.open("GET", "ajax.ashx?type=user&key="+userid, false);
	xmlHttp.send();
	var re=xmlHttp.responseText;
	//alert(re);
	var str = re.split(",");
	//alert(str[0]);
	//alert(str[1]);
	
	document.getElementById("<%= UserNameClientID%>").value = str[0];
	//alert(str[1]);
	if(str[1]==undefined)
	    return;
	document.getElementById("<%= UserDeptClientID%>").value = str[1];
}

</script>
        </div>
        <div style="height:50px; text-align:center;color:red">
        <br />
            提示：车管系统已经整合进入电力公司门户网站。
            <br />如果提示密码错误，请采用电力公司门户网站用户名和密码进行登录，或者从电力公司门户登录后直接进入。
        </div>
</asp:Content>
